package com.eddie.jdbc.app;

import java.util.Arrays;
import java.util.Map;

import com.eddie.jdbc.exception.BizCodeEnum;
import com.eddie.jdbc.service.PetStoreService;
import com.eddie.jdbc.service.impl.PetStoreServiceImpl;
import com.eddie.jdbc.vo.PetStoreVo;
import com.eddie.jdbc.vo.R;
import com.eddie.jdbc.vo.params.FindPetStoreParams;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * 
 *
 * @author Eddie
 * @email 1739263410@qq.com
 * @date 2022-03-03 17:57:21
 */
public class PetStoreController {
    private PetStoreService petStoreService = new PetStoreServiceImpl();

    public R loginStore(FindPetStoreParams params) {
        PetStoreVo petStoreVo = petStoreService.findByLoginUserAndPassword(params);
        return petStoreVo == null ? R.error(BizCodeEnum.CHECK_ACCOUNT_EXCEPTION.getCode(),
                BizCodeEnum.CHECK_ACCOUNT_EXCEPTION.getMsg())
                : R.ok().setData(petStoreVo);
    }

}
